package vn.easyforshopping.res;

import java.io.File;
import java.util.ArrayList;

import vn.easyforshopping.utils.IActionListener;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;


public class SDCardReader implements Runnable {

	private String path;
	BitmapFactory.Options options;
	ArrayList<Image> imageList = new ArrayList<Image>();
	
	public SDCardReader(String path) {
		this.path = path;
		options = new BitmapFactory.Options();
		options.inPreferredConfig = Bitmap.Config.ARGB_8888;
	}
	
	@Override
	public void run() {
		
	}
	
	public void readBitmap(String bitmapLink, IActionListener onCompleted) {
//		synchronized (imageList) {
//			imageList.add(image);
//			imageList.notifyAll();
//			return;
//		}
		
	}
	
	/**
	 * Kiem tra xem file co ton tai hay khong?
	 * @param path
	 * @return
	 */
	public boolean isFileAvailable(String fileName) {
		File file = new File(this.path+ fileName);
		return file.exists();
	}
	
	private Bitmap readBitmapFromSdCard(String filePath) {
		return BitmapFactory.decodeFile(filePath, options);
	}

}
